<?php
/**
 * Created by PhpStorm.
 * User: jack Wang
 * Date: 2021/11/14
 * Time: 15:55
 */

class Medal_model extends Base_Model
{
    public function __construct()
    {
        parent::__construct();
    }

    public function addMedal($data)
    {
        return $this->commonInsert('medal', $data);
    }

    public function delMedal($id)
    {
        $this->db->delete('medal', ['id' => $id]);
        return $this->db->affected_rows() ? true : false;
    }

    public function getAllMedal()
    {
        $res = $this->db->select('id,medal_name,desc,image,type,init_time')->from('medal')->get();
        return $res->num_rows() ? $res->result_array() : false;
    }
}